package liuwanghui.dto.request;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Positive;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDate;

// request/ProductCreateDTO.java
@Data
public class ProductCreateDTO {
    @NotBlank(message = "商品名称不能为空")
    private String name;

    @NotBlank(message = "商品类别不能为空")
    private String category;

    @NotNull(message = "商品价格不能为空")
    @Positive(message = "商品价格必须大于0")
    private BigDecimal price;

    @NotBlank(message = "计量单位不能为空")
    private String unit;

    @NotNull(message = "初始库存不能为空")
    @Positive(message = "初始库存必须大于0")
    private Integer stock;

    private String imageUrl;
    private String description;
    private LocalDate harvestDate;
}



